<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=, initial-scale=3.0">
  <title>将 obejct 对象中属性是空字符串的替换为 null</title>
</head>
<body>
  <script>
    const obj = {
      kind: '',
      age: 18
    }
    for(let i in obj) {
      if(obj[i] == '') {
        obj[i] = null
      }
    }
    console.log(obj)
  </script>
</body>
</html>